import { Component } from '@angular/core';
import { Product } from './product';

@Component({
  selector: 'inventory-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  products: Product[];

  constructor(){
this.products=[
  new Product(
    'MYSHOES',
    'Black Running Shoes',
    '/assets/imgs/products/black-shoes.jpg',
    ['Men','Shoes','Running Shoes'],
    109.99),

  new Product(
    'NEATOJACKET',
    'Blue Jacket',
    '/assets/imgs/products/blue-jacket.jpg',
    ['Women','Apparel','Jacket &Vests'],
    233.99),
    
    new Product(
      'NICEHAT',
      'A NICE BLACK HAT',
      '/assets/imgs/products/black-hat.jpg',
      ['Men','Acessories','Hats'],
    29.99),
];
  }
  onProductSelected(product:Product){
    console.log('在根组件中，响应产品：'+product.name+'选中事件！！！')
  }
}
